package yuxin;

import java.util.Scanner;

public class T2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[][] chars = new char[3][3];

        for(int i=0 ;i<3; i++) {
            String[] split = sc.nextLine().split(" ");
            for (int j=0; j<3; j++) {
                chars[i][j] = split[j].charAt(0);
            }
        }
        // 行
        for (int i=0; i<3; i++) {
            char ch = chars[i][0];
            if (ch == chars[i][1] && ch == chars[i][2]) {
                if (ch == 'K') {
                    System.out.println("KiKi wins!");
                    return;
                } else if (ch == 'B') {
                    System.out.println("BoBo wins!");
                    return;
                }
            }
        }

        // 列
        for (int i=0; i<3; i++) {
            char ch = chars[0][i];
            if (ch == chars[1][i] && ch == chars[2][i]) {
                if (ch == 'K') {
                    System.out.println("KiKi wins!");
                    return;
                } else if (ch == 'B') {
                    System.out.println("BoBo wins!");
                    return;
                }
            }
        }

        //斜着
        char ch = chars[1][1];
        if ((chars[0][0]==ch && chars[2][2]==ch) || (chars[2][0]==ch && chars[0][2]==ch)) {
            if (ch == 'K') {
                System.out.println("KiKi wins!");
                return;
            } else if (ch == 'B') {
                System.out.println("BoBo wins!");
                return;
            }
        }
        System.out.println("No winner!");
    }
}
